package byx.container.extension.aop.PatternTest;

import byx.aop.annotation.Around;
import byx.aop.annotation.Filter;
import byx.container.annotation.annotation.Register;
import byx.container.extension.aop.annotation.Enhance;
import byx.util.proxy.core.TargetMethod;

@Register
@Enhance(pattern = "A*")
public class Advice {
    @Around
    @Filter(name = "f", returnType = String.class)
    public String aroundF(TargetMethod targetMethod) {
        Object ret = targetMethod.invokeWithOriginalParams();
        return ret + " aroundF";
    }

    @Around
    @Filter(name = "g", returnType = String.class)
    public String aroundG(TargetMethod targetMethod) {
        Object ret = targetMethod.invokeWithOriginalParams();
        return ret + " aroundG";
    }
}
